package com.vipheyue.fastlib.dialog;

import android.content.Context;

import com.bigkoo.svprogresshud.SVProgressHUD;

/**
 * Created by heyue on 16/8/3.
 */

public class FastProgressDialog {

    private SVProgressHUD mSVProgressHUD;
    String text;

    public FastProgressDialog(Context context, String text) {
        this.text = text;
        mSVProgressHUD = new SVProgressHUD(context);
    }

    public SVProgressHUD show(String text) {
        this.text = text;
        mSVProgressHUD.showWithStatus(text);
        return mSVProgressHUD;
    }

    public SVProgressHUD show() {
        mSVProgressHUD.showWithStatus(text);
        return mSVProgressHUD;
    }

    public SVProgressHUD setText(String text) {
        mSVProgressHUD.setText(text);
        return mSVProgressHUD;
    }

    public void dismiss() {
        if (mSVProgressHUD.isShowing()) {
            mSVProgressHUD.dismiss();
        }
    }
}
